package com.chinaso.kotlinprojcet

import com.chinaso.kotlinprojcet.bean.CSNews
import com.chinaso.kotlinprojcet.bean.CSNewsList
import com.chinaso.kotlinprojcet.bean.GankNews
import com.chinaso.kotlinprojcet.bean.GankNewsList
import com.google.gson.Gson

/**
 * Created by Administrator on 17-11-24.
 */

class DataLoader{

    fun getGankNewsList(date:String): List<CSNews> {
        val url = Request.BASE_URL + date
//        return Gson().fromJson(Request(url).run(), GankNewsList::class.java).results
        return Gson().fromJson(Request(url).run(), CSNewsList::class.java).list
    }
}
